home *** CD-ROM | disk | FTP | other *** search
- Path: news.mindspring.com!usenet
- From: vtipres@atl.mindspring.com (shon frazier)
- Newsgroups: comp.lang.c
- Subject: Re: Permutation
- Date: Thu, 21 Mar 1996 04:29:10 GMT
- Organization: MindSpring Enterprises, Inc.
- Message-ID: <4iqlph$hib@B1FF.mindspring.com>
- References: <31503106.ABD@indi.aci.uni-heidelberg.de>
- Reply-To: vtipres@atl.mindspring.com
- NNTP-Posting-Host: user-168-121-120-68.dialup.mindspring.com
- X-Newsreader: Forte Free Agent 1.0.82
-
- Stefan Reichling <steve@indi.aci.uni-heidelberg.de> wrote:
-
- >Hi all,
-
- >my problem is how to determine all possible permutations between two
- >numberd arrays.
-
- >exmp: first array: 1 2 3 4
- > second array: 1 2 3 4
-
- > first permut: 1 2 3 4
- > 2 1 3 4
-
- > ect.
-
- >I know that the maximum number of possible permutations is n!
- >How can I determine all possible array pairs ?
-
- >thank's
-
- >steve
- >--
- >+---------------------------------------------------------------------+
- >| Stefan Reichling |
- >| Anorganisch-Chemisches Instiut |
- >| Tel +49-6221-548565 Universitaet Heidelberg |
- >| Fax +49-6221-545707 69120 Heidelberg |
- >| e-mail: steve@indi.aci.uni-heidelberg.de Germany |
- >| www: http://ix.urz.uni-heidelberg.de/~il1 |
- >+---------------------------------------------------------------------+
- If I understand you correctly, then simply multiply the number of
- array elements in the first array by the number of array elements in
- the second array.
-
- Therefore: given A has 4 elements (A[0],A[1],...) and B has 4
- elements (B[0],B[1],...) the total number of possible combinations is
- 4x4=16. Also applies to multi-dimensioanl arrays. If you have
- A[0][0] thru A[3][3] then there are a total of 16 elements.
-
-